<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWordVideoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('word_video', function (Blueprint $table){
            $table->increments('id');
            $table->smallInteger('type')->index()->default(0)->comment('0、英文 1、中文');
            $table->string('word')->default('0')->comment('单词');
            $table->string('video_url')->default('')->comment('音频url');
            $table->smallInteger('is_sync')->default(0)->comment('是否同步');
            $table->timestamps();
            $table->unique(['word', 'type','video_url']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('word_video');
    }
}
